#include "mainwindow.h"
#include "ui_mainwindow.h"
#include"QLabel"


MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    connect(&t,&Thread::sendTime,this,&MainWindow::showTime);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    t.start();//开启线程
}

void MainWindow::showTime(QString time)
{
     ui->label->setText(time);
}
